// layui导入模块并得到相应模块对象
layui.use(['table', 'layer', 'form', 'jquery', 'laydate'], function () {
    let table = layui.table;
    let layer = layui.layer;
    let form = layui.form;
    let $ = layui.jquery;
    //let laydate = layui.laydate; // 日期时间对象(有日期字段的话就用上)

    form.on("submit(formSave)", function (data) {
        // 将表单中各字段转化为Json字符串
        let dataStr = JSON.stringify(data.field);
        // 使用ajax提交数据
        $.ajax({
            type: "post",
            url: "/syllabuss/restful_syllabus",
            data: dataStr,
            dataType: "text",
            contentType: "application/json;charset=utf-8",
            success: function (msg) {
                layer.msg(msg); // 弹出提示框
                //重新加载表格数据
                $("#syllabusForm")[0].reset();
            }
        });
        return false;
    });



});
